package fhq.hcmute.edu.vn.system.util;

import java.io.PrintStream;

public class MyProgram {
	private Process child;

	public final void close() {
		PrintStream ps = new PrintStream(child.getOutputStream());
		ps.println("please_shutdown");
		ps.close();
	}

	public final boolean run(final String filePath) {
		String[] commands = { "cmd", "/c", "START", " ", filePath };
		try {
			Runtime rt = Runtime.getRuntime();
			child = rt.exec(commands);
			return true;
		} catch (Exception ioe) {
			ioe.printStackTrace();
		}
		return false;
	}
}
